import request from "@/utils/request";

/**
 * 区域管理列表
 * @param {*} param
 */
export function getAreaList(param) {
  const { pageNum, pageSize, ...data } = param;
  return request({
    url: `/gongyuan/area/list?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data
  });
}

/**
 * 区域管理-根据ID查询
 * @param {*} id
 */
export function getAreaDetail(id) {
  return request({
    url: `gongyuan/area/${id}`,
    method: "get"
  });
}

/**
 * 区域管理-删除
 * @param {*} id
 */
export function delArea(id) {
  return request({
    url: `gongyuan/area/${id}`,
    method: "delete"
  });
}

/**
 * 区域管理-添加
 * @param {*} data
 */
export function addArea(data) {
  return request({
    url: "/gongyuan/area",
    method: "post",
    data
  });
}

/**
 * 区域管理-更新
 * @param {*} data
 */
export function updateArea(data) {
  return request({
    url: "/gongyuan/area",
    method: "put",
    data
  });
}
